<template>
	<a-form-item
	:class="[hasError ? 'hhg-form-item-has-error' : '']"
	:label="labelName"
	:name="name"
	:rules="rules">
		<!-- 文本输入框 -->
		<a-input :value="modelValue" @input="$emit('update:modelValue', $event.target.value)" v-bind="attrs" class="searchInput">
			<template #prefixs>
				<slot name="prefixs"></slot>
			</template>
			<template #suffix>
				<slot name="suffix"></slot>
			</template>
		</a-input>
	</a-form-item>
</template>
<script setup>
import { onMounted, ref, defineProps, useAttrs } from 'vue'
//父组件传过来的值
const props = defineProps({
  config: {
	type: Object,
	default: ()=> {}
  }
})

const labelName = ref(props.config.labelName)
const name = ref(props.config.name)
const hasError = ref(props.config.hasError ? props.config.hasError : false)
const rules = ref(props.config.rules)
//组件属性穿透
const attrs = useAttrs()

// mounted
onMounted(() => {
})

</script>
<style lang="scss"></style>